package com.store.entity;

import java.util.Objects;

/**
 * 商品实体类
 */
public class Product extends BaseEntity{

    /** 商品id */
    private Integer id;
    /** 商家id */
    private Integer shopId;
    /** 商品类型 */
    private String itemType;
    /** 商品标题 */
    private String title;
    /** 商品单价 */
    private Long price;
    /** 库存数量 */
    private Integer num;
    /** 图片路径 */
    private String image;
    /** 商品状态  1：上架   2：下架   3：删除 */
    private Integer status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getShopId() {
        return shopId;
    }

    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Product product = (Product) o;
        return Objects.equals(id, product.id) &&
                Objects.equals(shopId, product.shopId) &&
                Objects.equals(itemType, product.itemType) &&
                Objects.equals(title, product.title) &&
                Objects.equals(price, product.price) &&
                Objects.equals(num, product.num) &&
                Objects.equals(image, product.image) &&
                Objects.equals(status, product.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), id, shopId, itemType, title, price, num, image, status);
    }
}
